﻿<CnGalWebSite.Components.Containers.MasaTitleContainer Icon="@IconType.Home.ToIconString()" Title="主要信息" Class="@Class" Collapable>
    <MRow>
        <MCol Cols="12" Md="6" Lg="3">
            <CnGalWebSite.Components.Images.UploadButton ShowCropper @bind-ImagePath="@Model.MainPicture" Type="ImageAspectType._16_9" Text="上传主图" Class="mb-4" />
         </MCol>
         <MCol Cols="12" Md="6" Lg="3">
            <CnGalWebSite.Components.Images.UploadButton ShowCropper @bind-ImagePath="@Model.Thumbnail" Type="ImageAspectType.None" Text="上传缩略图" Class="mb-4" Gallery />
         </MCol>
         <MCol Cols="12" Md="6" Lg="3">
             <CnGalWebSite.Components.Images.UploadButton @bind-ImagePath="@Model.BackgroundPicture" Type="ImageAspectType.None" Text="上传大背景图" Class="mb-4" />
         </MCol>
         <MCol Cols="12" Md="6" Lg="3" >
             <CnGalWebSite.Components.Images.UploadButton @bind-ImagePath="@Model.SmallBackgroundPicture" Type="ImageAspectType.None" Text="上传小背景图" Class="mb-4" />
         </MCol>
         <MCol Cols="12">
         </MCol>
         <MCol Cols="12" Md="6">
             <CnGalWebSite.Components.Inputs.MasaSelecte @bind-Value="Model.Type" TValue="LotteryType" Label="类型" />
         </MCol>
         <MCol Cols="12" Md="6">
             <CnGalWebSite.Components.Inputs.MasaSelecte @bind-Value="Model.ConditionType" TValue="LotteryConditionType" Label="参加抽奖的条件" />
         </MCol>
         <CnGalWebSite.Shared.MasaComponent.Shared.Editors.Cards.DisplayNameCard @bind-Name="Model.Name" @bind-DisplayName="Model.DisplayName" Class="form-group col-12 col-sm-6" />
        @if (Model.ConditionType == LotteryConditionType.BookingGame)
        {
            <MCol Cols="12" Md="6">
                <CnGalWebSite.Components.Inputs.MasaAutoComplete @bind-Value="@Model.GameName" Label="关联游戏" AutoCompleteItems="EntryGameItems" />
            </MCol>
        }
        @if ( Model.ConditionType == LotteryConditionType.Wishlist)
        {
            <MCol Cols="12" Md="6">
                <MTextField @bind-Value="Model.GameSteamId" Label="游戏SteamId" />
            </MCol>
        }
        <MCol Cols="12">
            <MTextarea Rows="3" @bind-Value="Model.BriefIntroduction" Label="简介" />
        </MCol>
        <MCol Cols="12" Md="6">
            <CnGalWebSite.Components.Inputs.MasaDatePicker @bind-Value="Model.BeginTime" ShowDate ShowTime Nullable="false" Label="开始时间" />
         </MCol>
         <MCol Cols="12" Md="6">
             <CnGalWebSite.Components.Inputs.MasaDatePicker @bind-Value="Model.EndTime" ShowDate ShowTime Nullable="false" Label="结束时间" />
         </MCol>
         @if (Model.Type == LotteryType.Automatic)
        {
            <MCol Cols="12" Md="6">
                <CnGalWebSite.Components.Inputs.MasaDatePicker @bind-Value="Model.LotteryTime" ShowDate ShowTime Nullable="false" Label="抽奖时间" />
             </MCol>
        }

    </MRow>
</CnGalWebSite.Components.Containers.MasaTitleContainer>

@code {
    [Parameter]
    public EditLotteryModel Model { get; set; }
    [Parameter]
    public string Class { get; set; }
    [Parameter]
    public List<string> EntryGameItems { get; set; }

}
